{% extends 'base/cms_base.html' %}

{% block title %}
    文章分类
{% endblock %}

{% block head %}
    <script src="{% static 'js/article_category.min.js' %}"></script>
{% endblock %}

{% block content-header %}
    <h3>文章分类</h3>
{% endblock %}

{% block content %}
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <div class="box-header">
                    <button id="add-btn" class="btn btn-primary pull-right">添加分类</button>
                </div>
                <div class="box-body">
                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th>分类名称</th>
                                <th>文章数量</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <body>
                            {% for category in categories %}
                                <tr data-pk="{{ category.pk }}" data-name="{{ category.name }}">
                                    <td>{{ category.name }}</td>
                                    <td>0</td>
                                    <td>
                                        <button class="edit-btn btn btn-warning btn-xs">编辑</button>
                                        <button class="delete-btn btn btn-danger btn-xs">删除</button>
                                    </td>
                                </tr>
                            {% endfor %}
                        </body>
                    </table>
                </div>
            </div>
        </div>
    </div>
{% endblock %}